#ifndef MYDEFINES_H_
#define MYDEFINES_H_

//Define screen 
#define SCREEN_W 840
#define SCREEN_H 480

//Define macro to delete pointer
#define SAFE_DEL(f) if (f) delete f; f = NULL;
#define SAFE_DEL_ARRAY(f) if (f) delete []f; f = NULL;

//Define to check leak
#define vmh_LEAK 1

//Define Use Data Packager, Shader Packager or NOT
#define vmh_DATA_PACKAGER 1
#define vmh_SHADER_PACKAGER 1

//Define to Runtime
#define WINRUNTIME 1

//Define the PI number
const float PI_NUMBER = 3.14159265358979323846f;

//Define variable type
typedef char* pchar;

//Define NULL if not defined
#ifndef NULL
#define NULL 0
#endif

//Define limit frame in second
#define LIMIT_FPS 60

//Define abstract funtion
#define ABSTRACT =0

//Define macro check error in console
#if _DEBUG
#define LOGI(...) printf(__VA_ARGS__)
#define LOGE(...) printf(__VA_ARGS__)
#define LOG(...) cout << __VA_ARGS__ << " never install ..." << endl;
#else
#define LOGI(...)
#define LOGE(...)
#define LOG(...)
#endif

//Define enum for GraphicsManager
enum GraphicsError
{
	ERROR_NO,
	ERROR_COMPILE_SHADER,
	ERROR_LINK_SHADER
};

enum VertexAttribute
{
	ATTRIB_POSITION,
	ATTRIB_TEXCOORD,
	ATTRIB_NORMAL,
	ATTRIB_COLOR
};

//Define enum for ShaderEffect
namespace effect_id
{
	enum 
	{
		GRAPHIC2DS,
		MESH3D,
		SHADER3D,
		SHADOW,
		SKYBOX,    
		NUMBER_OF_EFFECTS
	};
};

namespace shader3d
{
	enum
	{
		UN_WVPMATRIX,
		UN_WORLDMATRIX,
		UN_LIGHTWVP,
		UN_USELIGHTING,
		UN_LIGHTPOSITION,
		UN_LIGHTAMBIENT,
		UN_LIGHTDIFFUSE,
		UN_LIGHTSPECULAR,
		UN_USETEXTURE,
		UN_CAMERA,
		UN_MATERIALDIFFUSE,
		UN_MATERIALMAP,
		UN_SHADOWMAP,
		UN_SHININESS,
		NUMBER_OF_UNIFORMS
	};
}; 

namespace mesh3d
{
	enum
	{
		UN_WVPMATRIX,
		UN_WORLDMATRIX,
		UN_LIGHTWVP,
		UN_CAMERA,
		UN_LIGHTAMBIENT,
		UN_LIGHTSPECULAR,
		UN_LIGHTDIFFUSE,
		UN_SHININESS,
		UN_MATERIALMAP,
		UN_S_BUMPMAP,
		UN_USETEXTURE,
		NUMBER_OF_UNIFORMS
	};
};

namespace shadow
{
	enum
	{
		UN_WVPMATRIX,
		NUMBER_OF_UNIFORMS
	};
};

namespace skybox
{
	enum
	{
		UN_WVPMATRIX,
		UN_WORLDMATRIX,
		UN_SKYBOX,
		NUMBER_OF_UNIFORMS
	};
};

namespace graphic2ds
{
	enum
	{
		UN_WVPMATRIX,
		UN_MATERIALMAP,
		NUMBER_OF_UNIFORMS
	};
};

#endif
